package dao;

import model.Company;

import java.sql.SQLException;
import java.util.List;

/**
 * The interface Company dao.
 */
public interface CompanyDao {

    /**
     * Select by id company.
     *
     * @param cid the cid
     * @return the company
     * @throws SQLException the sql exception
     */
    Company selectById(long cid);

    /**
     * Login company.
     *
     * @param cname     the cname
     * @param cpassword the cpassword
     * @return the company
     */
    Company login(String cname, String cpassword);


    /**
     * Update int.
     *
     * @param company the company
     * @return the int
     */
    int update(Company company);

    /**
     * Insert int.
     *
     * @param company the company
     * @return the int
     */
    int insert(Company company);

    /**
     * Select all list.
     *
     * @param pageIndex the page index
     * @param pageSize  the page size
     * @return the list
     */
    List<Company> selectAll(int pageIndex, int pageSize);

    /**
     * Select by name list.
     *
     * @param cname     the cname
     * @param pageIndex the page index
     * @param pageSize  the page size
     * @return the list
     */
    List<Company> selectByName(String cname, int pageIndex, int pageSize);

    /**
     * Count all int.
     *
     * @return the int
     */
    int countAll();

    /**
     * Count by name int.
     *
     * @param cname the cname
     * @return the int
     */
    int countByName(String cname);


}
